upstream server_{{ name }} {
        # fail_timeout=0 means we always retry an upstream even if it failed
        # to return a good HTTP response

        # for UNIX domain socket setups or a TCP configuration
        server {{ bind }} fail_timeout=0;
}

server {
    location {{ location }} { try_files $uri $uri/ @proxy_{{ name }}; }
    location @proxy_{{ name }} {
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header Host $http_host;
        # proxy_buffering off;
        proxy_redirect off;
        proxy_pass http://server_{{ name }};
    }
}